#include <iostream>
#include <cmath>
#include <iomanip>
#include <math.h>

#include "RatioNumber.h"

using namespace std;

int static fact(int arg)
{
	int result = 1;
		if(arg != 0)
			{
				for(int i = arg; i >0; i--)
				{
					result *= i;
				}
			}
	return result;
}
int main()
{
	/*LongInt test(4);
	LongInt test2(2);
	LongInt test3;
	test3 = test + test2;
	cout<<test<<" + "<<test2<<" = "<<test3<<endl;
	RatioNumber a(test, test2);
	RatioNumber b(test2, test3);
	RatioNumber c = a+b;
	cout<<a<<"+"<<b<<"="<<c<<endl;
	system("Pause");
	return 0;
	*/
	
int n;
int x;
int exp = 0;
cout<<"Enter number of iterations"<<endl;
cin>>n;
cout<<"Enter x"<<endl;
cin>>x;
	for(int i = n; i >=0; i++)
		{
			exp += (pow(x,i))/fact(i);
		}
cout<<"exp(x) = "<<exp<<endl;
	
}